﻿using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace NoteTableUI.Models
{

    #region Models

    public class ChangePasswordModel
    {
        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Current password")]
        public string OldPassword { get; set; }

        [Required]
        [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "New password")]
        public string NewPassword { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirm new password")]
        [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }
    }

    public class LogOnModel
    {
        [Required(ErrorMessageResourceName = "UsernameValidate", ErrorMessageResourceType = typeof(Resources.Resources))]
        [LocalizedDisplayName("", ResourceName = "Username", ResourceType = typeof(Resources.Resources))]
        public string UserName { get; set; }

        [Required(ErrorMessageResourceName = "PasswordValidate", ErrorMessageResourceType = typeof(Resources.Resources))]
        [StringLength(100, MinimumLength = 6, ErrorMessageResourceName = "PasswordToShort", ErrorMessageResourceType = typeof(Resources.Resources))]
        [DataType(DataType.Password)]
        [LocalizedDisplayName("", ResourceName = "Password", ResourceType = typeof(Resources.Resources))]
        public string Password { get; set; }

        [LocalizedDisplayName("", ResourceName = "RememberMe", ResourceType = typeof(Resources.Resources))]
        public bool RememberMe { get; set; }
    }

    public class RegisterModel
    {
        [Required(ErrorMessageResourceName = "UsernameValidate", ErrorMessageResourceType = typeof(Resources.Resources))]
        [LocalizedDisplayName("", ResourceName = "Username", ResourceType = typeof(Resources.Resources))]
        public string UserName { get; set; }

        [Required(ErrorMessageResourceName = "EmailValidate", ErrorMessageResourceType = typeof(Resources.Resources))]
        [DataType(DataType.EmailAddress)]
        [LocalizedDisplayName("", ResourceName = "EmailAddress", ResourceType = typeof(Resources.Resources))]
        public string Email { get; set; }

        [Required(ErrorMessageResourceName = "PasswordValidate", ErrorMessageResourceType = typeof(Resources.Resources))]
        [StringLength(100, MinimumLength = 6, ErrorMessageResourceName = "PasswordToShort", ErrorMessageResourceType = typeof(Resources.Resources))]
        [DataType(DataType.Password)]
        [LocalizedDisplayName("", ResourceName = "Password", ResourceType = typeof(Resources.Resources))]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [LocalizedDisplayName("", ResourceName = "ConfirmPassword", ResourceType = typeof(Resources.Resources))]
        [Compare("Password", ErrorMessageResourceName = "PasswordNotMatch", ErrorMessageResourceType = typeof(Resources.Resources))]
        public string ConfirmPassword { get; set; }
    }

    #endregion

}
